//集中管理用户相关的异步请求
import request from "@/utils/request";

//登录
export const userLogin = (account) => {
  return request.post("login", account);
};

//注册
export const userReg = (account) => {
  return request.post("users", account);
};

//账号列表
export const userGet = () => {
  return request.get("users");
};

//新增角色
export const rolePost = (role) => {
  return request.post("classes/VueRole", role);
};

//角色列表
export const roleGet = (roleId) => {
  let param = roleId ? `/${roleId}` : "";
  return request.get(`classes/VueRole${param}`);
};

//角色更新
export const rolePut = (objectId, role) => {
  return request.put(`classes/VueRole/${objectId}`, role);
};

//角色删除
export const roleDel = (objectId) => {
  return request.delete(`classes/VueRole/${objectId}`);
};
